aux_source_directory(. SOURCESCODE)
include_directories(.)
include(FindPkgConfig)
pkg_check_modules(GLIB REQUIRED glib-2.0)
include_directories(${GLIB_INCLUDE_DIRS})
add_library(kysdk-hardware SHARED ${SOURCESCODE})
set_target_properties(kysdk-hardware PROPERTIES VERSION 2.0.0 SOVERSION 1)
#add_executable(kync-test test/kync-test.c)
#add_executable(kycpu-test test/kycpu-test.c)
#add_executable(kyprinterlist-test test/kyprinterlist-test.c)
#add_executable(kyprinterprint-test test/kyprinterprint-test.c)
#add_executable(kyusb-test test/kyusb-test.c)
#add_executable(kybios-test test/kybios-test.c)
#add_executable(kyboard-test test/kyboard-test.c)
#add_executable(kydisplay-test test/kydisplay-test.c)
#add_executable(kyedid-test test/kyedid-test.c)
#add_executable(kybluetooth-test test/kybluetooth-test.c)
#add_executable(kyfan-test test/kyfan-test.c)
#add_executable(kyhw-test test/kyhw-test.c)
# 额外链接的库在这一行
target_link_libraries(kysdk-hardware kysdk-log kysdk-config pthread systemd cups curl udev X11 Xrandr bluetooth sensors hd pci gobject-2.0 dbus-glib-1 ${GLIB_LIBRARIES})
#target_link_libraries(kyprinterprint-test kysdk-hardware)
#target_link_libraries(kyprinterlist-test kysdk-hardware)
#target_link_libraries(kync-test kysdk-hardware)
#target_link_libraries(kycpu-test kysdk-hardware)
#target_link_libraries(kyusb-test kysdk-hardware)
#target_link_libraries(kybios-test kysdk-hardware)
#target_link_libraries(kyboard-test kysdk-hardware)
#target_link_libraries(kydisplay-test kysdk-hardware)
#target_link_libraries(kyedid-test kysdk-hardware)
#target_link_libraries(kybluetooth-test kysdk-hardware)
#target_link_libraries(kyfan-test kysdk-hardware)
#target_link_libraries(kyhw-test kysdk-hardware)

install(TARGETS kysdk-hardware
        DESTINATION ${CMAKE_INSTALL_RPATH})

install(FILES libkync.h
        DESTINATION include/kysdk/kysdk-system)

install(FILES libkycpu.h
        DESTINATION include/kysdk/kysdk-system)

install(FILES libkyprinter.h
        DESTINATION include/kysdk/kysdk-system)

install(FILES libkybios.h
        DESTINATION include/kysdk/kysdk-system)

install(FILES libkyboard.h
        DESTINATION include/kysdk/kysdk-system)

install(FILES libkyusb.h
        DESTINATION include/kysdk/kysdk-system)

install(FILES libkydisplay.h
        DESTINATION include/kysdk/kysdk-system)

install(FILES libkyedid.h
        DESTINATION include/kysdk/kysdk-system)

install(FILES libkybluetooth.h
        DESTINATION include/kysdk/kysdk-system)

install(FILES libkyfan.h
        DESTINATION include/kysdk/kysdk-system)

install(FILES libkyhw.h
        DESTINATION include/kysdk/kysdk-system)
